GXCheckColor
You can use theGXCheckColor
function to determine if a color is either within a given gamut in a particular color space, or representable in a given color set.
boolean GXCheckColor(const gxColor *source, gxColorSpace space, gxColorSet aSet, gxColorProfile profile);
source
- A pointer to the color to check.
space
- The color space to check the source color against.
aSet
- A reference to a color set to check the source color against. This parameter must be
nil
if thespace
parameter is notgxIndexedSpace
.profile
- A reference to a color profile to check the source color against.
GXCheckColor
determines whether the source color is within the color gamut represented by this profile and thespace
color space.- function result
true
if the source color is contained in the specified color set, or if it is within the gamut of the specified color space and color profile; otherwise,false
.DESCRIPTION
TheGXCheckColor
function has two purposes. One is that you can use it to see if a given color exactly matches a color within a color set. For example, you can test whether a color matches a Pantone® or other spot color standard. To do this check, make sure that thespace
parameter specifies indexed color space and that theaSet
parameter is notnil
.You can also use the
GXCheckColor
function to see if a given color can be drawn on a given view device. The function converts the source color to the color space represented in thespace
parameter, using the color profile in theprofile
parameter. If the resulting color is out of the gamut represented byspace
andprofile
, the function returnsfalse
.SPECIAL CONSIDERATIONS
If you are using this function to test a color against a color set, it is unlikely to find a match (which must be exact) unless the source color and the color set referenced in theaSet
parameter are based on the same color space and use identical color profiles.ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory color_is_nil colorSpace_out_of_range (debugging version) Warnings colorSet_index_out_of_range